import React from 'react';
import { Card, Descriptions } from 'antd';

export default class TemperatureDataTab extends React.Component<any, any> {
  render() {
    const { energyStorageTotal, energyStorageVoList } = this.props;
    const energyStorageVo = energyStorageVoList
      ? energyStorageVoList.map((item, index) => {
          return (
            <Descriptions
              bordered
              size="small"
              style={{ padding: 0, marginTop: 20, fontWeight: 'normal' }}
              title={`${index + 1}可充电储能子系统温度信息`}
              key={index}
            >
              <Descriptions.Item label="可充电储能子系统号">
                {item.energyStorageSystemNum}
              </Descriptions.Item>
              <Descriptions.Item label="可充电储能温度探针个数" span={2}>
                {item.probeTotal}
              </Descriptions.Item>

              {item.probeTemperatureList?.map((item2, index2) => {
                return (
                  <Descriptions.Item label={`温度探针${index2 + 1}温度值(℃)`} key={index2}>
                    {item2 ? `${item2}` : ''}
                  </Descriptions.Item>
                );
              })}
            </Descriptions>
          );
        })
      : '';
    return (
      <>
        <Descriptions bordered size="small">
          <Descriptions.Item label="可充电储能子系统个数" span={1}>
            {energyStorageTotal}
          </Descriptions.Item>
        </Descriptions>
        {energyStorageVo}
      </>
    );
  }
}
